/***********************************************
 This file is part of redia-bapps-main-ios.
 
 Copyright (c) 2015 Redia A/S
 
 Redia-bapps-main-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 redia-bapps-main-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-bapps-main-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */

//
//  BARootViewController.h
//  redia-bapps-ios
//
//  Created by Henrik Lynbech on 14/08/13.
//  Copyright (c) 2013 Redia A/S. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "BACustomNavigationController.h"
#import "MWFSlideNavigationViewController.h"
#import "BAMaterialViewController.h"
#import "BAMaterialViewControllerProtocol.h"

#ifdef BA_IMF_BUILD
#import "IMFAddMaterialToIMFPackageViewController.h"
#else
@protocol IMFAddMaterialToIMFPackageViewControllerDelegate;
#endif



typedef enum : NSUInteger {
    BARootViewAppStateIntroGuideMode,
    BARootViewAppStateInitialSelectionAndLoginMode,
    BARootViewAppStateUserTabBarMode,
    BARootViewAppStateLibrarianSearchMode,
    BARootViewAppStateImfEditorMode,
    BARootViewAppStateImfEditorWithLibrarianSearchMode,
} BARootViewAppState;


@interface BARootViewController : UIViewController <MWFSlideNavigationViewControllerDataSource,
                                                        MWFSlideNavigationViewControllerDelegate,
                                                        UITabBarControllerDelegate,
                                                        UIAlertViewDelegate>
{
    BACustomNavigationController* rootLevelNavigationController;
    
    UITabBarController* rootLevelTabBarController;
}

@property (nonatomic, readonly) BARootViewAppState currentAppState;

SINGLETON_DECL_GCD(BARootViewController)

- (void)switchToLibrarySelectionWithShowingLoginScreen:(BOOL)doShowLogin;

- (void)switchToMainTabBarAppMode;

- (void)switchToUserLibraryAppMode;
- (void)switchToLibrarianOrImfEditorAppMode;
//deprecated: -(void)switchToEditorAppMode;

- (UIViewController<BAMaterialViewControllerProtocol>*)createMaterialViewController;
- (void)createIMFAddMaterialToIMFPackageViewController:(BARecord*)record delegate:(id<IMFAddMaterialToIMFPackageViewControllerDelegate>)delegate;

- (void)openUserSearchViewWithSearchString:(NSString*)searchString;

- (void)dismissIntroGuide:(id)sender;
- (void)showUserGuide;
- (void)dismissUserGuide:(id)sender;
- (BOOL)isShowingUserGuide;


@property (nonatomic, assign) NSInteger packagesCount;

@end
